/* eslint-disable no-shadow,camelcase,import/no-mutable-exports,no-console */
// TODO: 自动生成的 src/utils/config 禁用了部分 eslint, 请查看 scripts/genConfig.js

/**
 * 不要直接修改这个文件, 请修改 config/apiConfig 文件
 * Config - 全局统一配置
 * @date: 2018-6-20

 */
// #region initConfig
var CLIENT_ID = "".concat(process.env.CLIENT_ID);
var API_HOST = "".concat(process.env.API_HOST);
var BPM_HOST = "".concat(process.env.BPM_HOST);
var WFP_EDITOR = "".concat(process.env.WFP_EDITOR);
var WEBSOCKET_URL = "".concat(process.env.WEBSOCKET_HOST);
var IM_ENABLE = "".concat(process.env.IM_ENABLE);
var TRACE_LOG_ENABLE = "".concat(process.env.TRACE_LOG_ENABLE);
var MULTIPLE_SKIN_ENABLE = "".concat(process.env.MULTIPLE_SKIN_ENABLE);
var TOP_MENU_LABELS = "".concat(process.env.TOP_MENU_LABELS);
var TOP_MENU_UNION_LABEL = "".concat(process.env.TOP_MENU_UNION_LABEL);
var ENV_SIGN = "".concat(process.env.ENV_SIGN);
var INVALID_TIME = "".concat(process.env.INVALID_TIME);
var CUSTOMIZE_ICON_NAME = "".concat(process.env.CUSTOMIZE_ICON_NAME);
var MULTIPLE_LANGUAGE_ENABLE = "".concat(process.env.MULTIPLE_LANGUAGE_ENABLE);
var CPAAS_PLATFORM = '/cpfm';
var CPAAS_IAM = '/iam';
var CPAAS_DTT = '/cdtt';
var CPAAS_MSG = '/cmsg';
var CPAAS_PTL = '/cptl';
var CPAAS_WFL = '/cwfl';
var CPAAS_DTW = '/cdtw';
var CPAAS_CDTW = '/cdtw';
var CPAAS_SDR = '/csdr';
var CPAAS_CSGP = '/csgp';
var CPAAS_CITF = '/citf';
var CPAAS_CFLE = '/cfle';
var CPAAS_OAUTH = '/oauth';
var CPAAS_ASGARD = '/cagd';
var CPAAS_IMP = '/cimp';
var CPAAS_RPT = '/crpt';
var CPAAS_CCNF = '/ccnf';
var CPAAS_CWFP = '/cwfp';
var CPAAS_FILE = changeCPAAS_FILE(API_HOST, CPAAS_CFLE);
var CPAAS_NLP = '/cnlp';
var CPAAS_CPAY = '/cpay';
var CPAAS_CEXL = '/cexl';
var CPAAS_MNT = '/cmnt';
var CPAAS_INVOICE = '/civc';
var CPAAS_IM = '/cims';
var CPAAS_OCR = '/cocr';
var CPAAS_CHG = '/cchg';
var CPAAS_ADM = '/cadm';
var CPAAS_DPM = '/cdpm';
var CPAAS_CSRH = '/csrh';
var CPAAS_CMDE = '/cmde';
var CPAAS_CRES = '/cres';
var CPAAS_CLCD = '/clcd';
var CPAAS_CLOD = '/clod';
var CPAAS_CIOT = '/ciot';
var CPAAS_CEBK = '/cebk';
var CPAAS_ALT = '/calt';
var CPAAS_CEVT = '/cevt';
var CPAAS_CDSC = '/cdsc';
var AUTH_HOST = changeAUTH_HOST(API_HOST, CPAAS_OAUTH);
var LOGIN_URL = "".concat(process.env.LOGIN_URL || "".concat(AUTH_HOST, "/oauth/authorize?response_type=token&client_id=").concat(CLIENT_ID));
var LOGOUT_URL = "".concat(process.env.LOGOUT_URL || "".concat(AUTH_HOST, "/logout"));
var AUTH_SELF_URL = changeAUTH_SELF_URL(API_HOST, CPAAS_IAM);
var VERSION_IS_OP = "".concat(process.env.PLATFORM_VERSION) === 'OP';
var BKT_PUBLIC = "".concat(process.env.BKT_PUBLIC || 'public');
var BKT_PLATFORM = "".concat(process.env.BKT_PLATFORM || 'cpfm');
var BKT_MSG = "".concat(process.env.BKT_MSG || 'cmsg');
var BKT_SDR = "".concat(process.env.BKT_SDR || 'csdr');
var BKT_RPT = "".concat(process.env.BKT_RPT || 'crpt');
var BKT_INVOICE = "".concat(process.env.BKT_INVOICE || 'civc');
var BKT_OCR = "".concat(process.env.BKT_OCR || 'cocr');
var BKT_ADM = "".concat(process.env.BKT_ADM || 'cadm');
var BKT_CWFP = "".concat(process.env.BKT_CWFP || 'cwfp');
var BKT_CIMS = "".concat(process.env.BKT_CIMS || 'cims');
var BKT_CITF = "".concat(process.env.BKT_CITF || 'citf');
var BKT_CIMP = "".concat(process.env.BKT_CIMP || 'cimp');
var BKT_CFILE = "".concat(process.env.BKT_CFILE || 'cfle');
var BKT_CIOT = "".concat(process.env.BKT_CIOT || 'ciot'); // #endregion
// #region changeConfig Funcs

function changeCPAAS_FILE(API_HOST, CPAAS_CFLE) {
  return "".concat(API_HOST).concat(CPAAS_CFLE);
}

function changeAUTH_HOST(API_HOST, CPAAS_OAUTH) {
  return "".concat(API_HOST).concat(CPAAS_OAUTH);
}

function changeAUTH_SELF_URL(API_HOST, CPAAS_IAM) {
  return "".concat(API_HOST).concat(CPAAS_IAM, "/cpaas/v1/users/self");
}

function changeVERSION_IS_OP(PLATFORM_VERSION) {
  return "".concat(PLATFORM_VERSION) === 'OP'; //  OP版
} // #endregion
// #region changeRoute


window.changeRoute = function changeRoute(key, value) {
  if (key && value) {
    switch (key) {
      case 'BPM_HOST':
        BPM_HOST = value;
        break;

      case 'WFP_EDITOR':
        WFP_EDITOR = value;
        break;

      case 'WEBSOCKET_URL':
        WEBSOCKET_URL = value;
        break;

      case 'IM_ENABLE':
        IM_ENABLE = value;
        break;

      case 'TRACE_LOG_ENABLE':
        TRACE_LOG_ENABLE = value;
        break;

      case 'MULTIPLE_SKIN_ENABLE':
        MULTIPLE_SKIN_ENABLE = value;
        break;

      case 'TOP_MENU_LABELS':
        TOP_MENU_LABELS = value;
        break;

      case 'TOP_MENU_UNION_LABEL':
        TOP_MENU_UNION_LABEL = value;
        break;

      case 'ENV_SIGN':
        ENV_SIGN = value;
        break;

      case 'INVALID_TIME':
        INVALID_TIME = value;
        break;

      case 'CUSTOMIZE_ICON_NAME':
        CUSTOMIZE_ICON_NAME = value;
        break;

      case 'MULTIPLE_LANGUAGE_ENABLE':
        MULTIPLE_LANGUAGE_ENABLE = value;
        break;

      case 'CPAAS_PLATFORM':
        CPAAS_PLATFORM = value;
        break;

      case 'CPAAS_IAM':
        CPAAS_IAM = value;
        AUTH_SELF_URL = changeAUTH_SELF_URL(API_HOST, value);
        break;

      case 'CPAAS_DTT':
        CPAAS_DTT = value;
        break;

      case 'CPAAS_MSG':
        CPAAS_MSG = value;
        break;

      case 'CPAAS_PTL':
        CPAAS_PTL = value;
        break;

      case 'CPAAS_WFL':
        CPAAS_WFL = value;
        break;

      case 'CPAAS_DTW':
        CPAAS_DTW = value;
        break;

      case 'CPAAS_CDTW':
        CPAAS_CDTW = value;
        break;

      case 'CPAAS_SDR':
        CPAAS_SDR = value;
        break;

      case 'CPAAS_CSGP':
        CPAAS_CSGP = value;
        break;

      case 'CPAAS_CITF':
        CPAAS_CITF = value;
        break;

      case 'CPAAS_CFLE':
        CPAAS_CFLE = value;
        CPAAS_FILE = changeCPAAS_FILE(API_HOST, value);
        break;

      case 'CPAAS_OAUTH':
        CPAAS_OAUTH = value;
        AUTH_HOST = changeAUTH_HOST(API_HOST, value);
        break;

      case 'CPAAS_ASGARD':
        CPAAS_ASGARD = value;
        break;

      case 'CPAAS_IMP':
        CPAAS_IMP = value;
        break;

      case 'CPAAS_RPT':
        CPAAS_RPT = value;
        break;

      case 'CPAAS_CCNF':
        CPAAS_CCNF = value;
        break;

      case 'CPAAS_CWFP':
        CPAAS_CWFP = value;
        break;

      case 'CPAAS_FILE':
        CPAAS_FILE = value;
        break;

      case 'API_HOST':
        CPAAS_FILE = changeCPAAS_FILE(value, CPAAS_CFLE);
        AUTH_HOST = changeAUTH_HOST(value, CPAAS_OAUTH);
        AUTH_SELF_URL = changeAUTH_SELF_URL(value, CPAAS_IAM);
        break;

      case 'CPAAS_NLP':
        CPAAS_NLP = value;
        break;

      case 'CPAAS_CPAY':
        CPAAS_CPAY = value;
        break;

      case 'CPAAS_CEXL':
        CPAAS_CEXL = value;
        break;

      case 'CPAAS_MNT':
        CPAAS_MNT = value;
        break;

      case 'CPAAS_INVOICE':
        CPAAS_INVOICE = value;
        break;

      case 'CPAAS_IM':
        CPAAS_IM = value;
        break;

      case 'CPAAS_OCR':
        CPAAS_OCR = value;
        break;

      case 'CPAAS_CHG':
        CPAAS_CHG = value;
        break;

      case 'CPAAS_ADM':
        CPAAS_ADM = value;
        break;

      case 'CPAAS_DPM':
        CPAAS_DPM = value;
        break;

      case 'CPAAS_CSRH':
        CPAAS_CSRH = value;
        break;

      case 'CPAAS_CMDE':
        CPAAS_CMDE = value;
        break;

      case 'CPAAS_CRES':
        CPAAS_CRES = value;
        break;

      case 'CPAAS_CLCD':
        CPAAS_CLCD = value;
        break;

      case 'CPAAS_CLOD':
        CPAAS_CLOD = value;
        break;

      case 'CPAAS_CIOT':
        CPAAS_CIOT = value;
        break;

      case 'CPAAS_CEBK':
        CPAAS_CEBK = value;
        break;

      case 'CPAAS_ALT':
        CPAAS_ALT = value;
        break;

      case 'CPAAS_CEVT':
        CPAAS_CEVT = value;
        break;

      case 'CPAAS_CDSC':
        CPAAS_CDSC = value;
        break;

      case 'AUTH_HOST':
        AUTH_HOST = value;
        break;

      case 'LOGIN_URL':
        LOGIN_URL = value;
        break;

      case 'LOGOUT_URL':
        LOGOUT_URL = value;
        break;

      case 'AUTH_SELF_URL':
        AUTH_SELF_URL = value;
        break;

      case 'VERSION_IS_OP':
        VERSION_IS_OP = value;
        break;

      case 'PLATFORM_VERSION':
        VERSION_IS_OP = changeVERSION_IS_OP(value);
        break;

      case 'BKT_PUBLIC':
        BKT_PUBLIC = value;
        break;

      case 'BKT_PLATFORM':
        BKT_PLATFORM = value;
        break;

      case 'BKT_MSG':
        BKT_MSG = value;
        break;

      case 'BKT_SDR':
        BKT_SDR = value;
        break;

      case 'BKT_RPT':
        BKT_RPT = value;
        break;

      case 'BKT_INVOICE':
        BKT_INVOICE = value;
        break;

      case 'BKT_OCR':
        BKT_OCR = value;
        break;

      case 'BKT_ADM':
        BKT_ADM = value;
        break;

      case 'BKT_CWFP':
        BKT_CWFP = value;
        break;

      case 'BKT_CIMS':
        BKT_CIMS = value;
        break;

      case 'BKT_CITF':
        BKT_CITF = value;
        break;

      case 'BKT_CIMP':
        BKT_CIMP = value;
        break;

      case 'BKT_CFILE':
        BKT_CFILE = value;
        break;

      case 'BKT_CIOT':
        BKT_CIOT = value;
        break;

      default:
        console.error("".concat(key, " is not exists"));
        helpMethod();
        break;
    }
  } else {
    helpMethod(key);
  }
}; // #endregion
// #region helpMethod


var helpMethodAssist = {
  BPM_HOST: {
    changeConfig: ['BPM_HOST'],
    depBy: []
  },
  WFP_EDITOR: {
    changeConfig: ['WFP_EDITOR'],
    depBy: []
  },
  WEBSOCKET_URL: {
    changeConfig: ['WEBSOCKET_URL'],
    depBy: []
  },
  IM_ENABLE: {
    changeConfig: ['IM_ENABLE'],
    depBy: []
  },
  TRACE_LOG_ENABLE: {
    changeConfig: ['TRACE_LOG_ENABLE'],
    depBy: []
  },
  MULTIPLE_SKIN_ENABLE: {
    changeConfig: ['MULTIPLE_SKIN_ENABLE'],
    depBy: []
  },
  TOP_MENU_LABELS: {
    changeConfig: ['TOP_MENU_LABELS'],
    depBy: []
  },
  TOP_MENU_UNION_LABEL: {
    changeConfig: ['TOP_MENU_UNION_LABEL'],
    depBy: []
  },
  ENV_SIGN: {
    changeConfig: ['ENV_SIGN'],
    depBy: []
  },
  INVALID_TIME: {
    changeConfig: ['INVALID_TIME'],
    depBy: []
  },
  CUSTOMIZE_ICON_NAME: {
    changeConfig: ['CUSTOMIZE_ICON_NAME'],
    depBy: []
  },
  MULTIPLE_LANGUAGE_ENABLE: {
    changeConfig: ['MULTIPLE_LANGUAGE_ENABLE'],
    depBy: []
  },
  CPAAS_PLATFORM: {
    changeConfig: ['CPAAS_PLATFORM'],
    depBy: []
  },
  CPAAS_IAM: {
    changeConfig: ['CPAAS_IAM', 'AUTH_SELF_URL'],
    depBy: []
  },
  CPAAS_DTT: {
    changeConfig: ['CPAAS_DTT'],
    depBy: []
  },
  CPAAS_MSG: {
    changeConfig: ['CPAAS_MSG'],
    depBy: []
  },
  CPAAS_PTL: {
    changeConfig: ['CPAAS_PTL'],
    depBy: []
  },
  CPAAS_WFL: {
    changeConfig: ['CPAAS_WFL'],
    depBy: []
  },
  CPAAS_DTW: {
    changeConfig: ['CPAAS_DTW'],
    depBy: []
  },
  CPAAS_CDTW: {
    changeConfig: ['CPAAS_CDTW'],
    depBy: []
  },
  CPAAS_SDR: {
    changeConfig: ['CPAAS_SDR'],
    depBy: []
  },
  CPAAS_CSGP: {
    changeConfig: ['CPAAS_CSGP'],
    depBy: []
  },
  CPAAS_CITF: {
    changeConfig: ['CPAAS_CITF'],
    depBy: []
  },
  CPAAS_CFLE: {
    changeConfig: ['CPAAS_CFLE', 'CPAAS_FILE'],
    depBy: []
  },
  CPAAS_OAUTH: {
    changeConfig: ['CPAAS_OAUTH', 'AUTH_HOST'],
    depBy: []
  },
  CPAAS_ASGARD: {
    changeConfig: ['CPAAS_ASGARD'],
    depBy: []
  },
  CPAAS_IMP: {
    changeConfig: ['CPAAS_IMP'],
    depBy: []
  },
  CPAAS_RPT: {
    changeConfig: ['CPAAS_RPT'],
    depBy: []
  },
  CPAAS_CCNF: {
    changeConfig: ['CPAAS_CCNF'],
    depBy: []
  },
  CPAAS_CWFP: {
    changeConfig: ['CPAAS_CWFP'],
    depBy: []
  },
  CPAAS_FILE: {
    changeConfig: ['CPAAS_FILE'],
    depBy: ['CPAAS_FILE', 'CPAAS_FILE']
  },
  API_HOST: {
    changeConfig: ['CPAAS_FILE', 'AUTH_HOST', 'AUTH_SELF_URL'],
    depBy: []
  },
  CPAAS_NLP: {
    changeConfig: ['CPAAS_NLP'],
    depBy: []
  },
  CPAAS_CPAY: {
    changeConfig: ['CPAAS_CPAY'],
    depBy: []
  },
  CPAAS_CEXL: {
    changeConfig: ['CPAAS_CEXL'],
    depBy: []
  },
  CPAAS_MNT: {
    changeConfig: ['CPAAS_MNT'],
    depBy: []
  },
  CPAAS_INVOICE: {
    changeConfig: ['CPAAS_INVOICE'],
    depBy: []
  },
  CPAAS_IM: {
    changeConfig: ['CPAAS_IM'],
    depBy: []
  },
  CPAAS_OCR: {
    changeConfig: ['CPAAS_OCR'],
    depBy: []
  },
  CPAAS_CHG: {
    changeConfig: ['CPAAS_CHG'],
    depBy: []
  },
  CPAAS_ADM: {
    changeConfig: ['CPAAS_ADM'],
    depBy: []
  },
  CPAAS_DPM: {
    changeConfig: ['CPAAS_DPM'],
    depBy: []
  },
  CPAAS_CSRH: {
    changeConfig: ['CPAAS_CSRH'],
    depBy: []
  },
  CPAAS_CMDE: {
    changeConfig: ['CPAAS_CMDE'],
    depBy: []
  },
  CPAAS_CRES: {
    changeConfig: ['CPAAS_CRES'],
    depBy: []
  },
  CPAAS_CLCD: {
    changeConfig: ['CPAAS_CLCD'],
    depBy: []
  },
  CPAAS_CLOD: {
    changeConfig: ['CPAAS_CLOD'],
    depBy: []
  },
  CPAAS_CIOT: {
    changeConfig: ['CPAAS_CIOT'],
    depBy: []
  },
  CPAAS_CEBK: {
    changeConfig: ['CPAAS_CEBK'],
    depBy: []
  },
  CPAAS_ALT: {
    changeConfig: ['CPAAS_ALT'],
    depBy: []
  },
  CPAAS_CEVT: {
    changeConfig: ['CPAAS_CEVT'],
    depBy: []
  },
  CPAAS_CDSC: {
    changeConfig: ['CPAAS_CDSC'],
    depBy: []
  },
  AUTH_HOST: {
    changeConfig: ['AUTH_HOST'],
    depBy: ['AUTH_HOST', 'AUTH_HOST']
  },
  LOGIN_URL: {
    changeConfig: ['LOGIN_URL'],
    depBy: []
  },
  LOGOUT_URL: {
    changeConfig: ['LOGOUT_URL'],
    depBy: []
  },
  AUTH_SELF_URL: {
    changeConfig: ['AUTH_SELF_URL'],
    depBy: ['AUTH_SELF_URL', 'AUTH_SELF_URL']
  },
  VERSION_IS_OP: {
    changeConfig: ['VERSION_IS_OP'],
    depBy: ['VERSION_IS_OP']
  },
  PLATFORM_VERSION: {
    changeConfig: ['VERSION_IS_OP'],
    depBy: []
  },
  BKT_PUBLIC: {
    changeConfig: ['BKT_PUBLIC'],
    depBy: []
  },
  BKT_PLATFORM: {
    changeConfig: ['BKT_PLATFORM'],
    depBy: []
  },
  BKT_MSG: {
    changeConfig: ['BKT_MSG'],
    depBy: []
  },
  BKT_SDR: {
    changeConfig: ['BKT_SDR'],
    depBy: []
  },
  BKT_RPT: {
    changeConfig: ['BKT_RPT'],
    depBy: []
  },
  BKT_INVOICE: {
    changeConfig: ['BKT_INVOICE'],
    depBy: []
  },
  BKT_OCR: {
    changeConfig: ['BKT_OCR'],
    depBy: []
  },
  BKT_ADM: {
    changeConfig: ['BKT_ADM'],
    depBy: []
  },
  BKT_CWFP: {
    changeConfig: ['BKT_CWFP'],
    depBy: []
  },
  BKT_CIMS: {
    changeConfig: ['BKT_CIMS'],
    depBy: []
  },
  BKT_CITF: {
    changeConfig: ['BKT_CITF'],
    depBy: []
  },
  BKT_CIMP: {
    changeConfig: ['BKT_CIMP'],
    depBy: []
  },
  BKT_CFILE: {
    changeConfig: ['BKT_CFILE'],
    depBy: []
  },
  BKT_CIOT: {
    changeConfig: ['BKT_CIOT'],
    depBy: []
  }
};

function helpMethod(key) {
  if (key && helpMethodAssist[key]) {
    console.error("".concat(key, " \u4F1A\u66F4\u6539: [").concat(helpMethodAssist[key].changeConfig.join(', '), "], \u88AB\u7EA7\u8FDE\u66F4\u6539: [").concat(helpMethodAssist[key].depBy.join(', '), "]"));
  } else {
    console.error('使用 changeRoute() 查看可以更改的参数');
    console.error('使用 changeRoute("参数") 查看具体改变');
    console.error('使用 changeRoute("参数", "参数值") 更改参数');
    console.error("\u53EF\u4EE5\u66F4\u6539\u7684\u914D\u7F6E: [".concat(Object.keys(helpMethodAssist).join(', '), "]"));
  }
} // #endregion
// #regioin exportsConfig


export { CLIENT_ID, API_HOST, BPM_HOST, WFP_EDITOR, WEBSOCKET_URL, IM_ENABLE, TRACE_LOG_ENABLE, MULTIPLE_SKIN_ENABLE, TOP_MENU_LABELS, TOP_MENU_UNION_LABEL, ENV_SIGN, INVALID_TIME, CUSTOMIZE_ICON_NAME, MULTIPLE_LANGUAGE_ENABLE, CPAAS_PLATFORM, CPAAS_IAM, CPAAS_DTT, CPAAS_MSG, CPAAS_PTL, CPAAS_WFL, CPAAS_DTW, CPAAS_CDTW, CPAAS_SDR, CPAAS_CSGP, CPAAS_CITF, CPAAS_CFLE, CPAAS_OAUTH, CPAAS_ASGARD, CPAAS_IMP, CPAAS_RPT, CPAAS_CCNF, CPAAS_CWFP, CPAAS_FILE, CPAAS_NLP, CPAAS_CPAY, CPAAS_CEXL, CPAAS_MNT, CPAAS_INVOICE, CPAAS_IM, CPAAS_OCR, CPAAS_CHG, CPAAS_ADM, CPAAS_DPM, CPAAS_CSRH, CPAAS_CMDE, CPAAS_CRES, CPAAS_CLCD, CPAAS_CLOD, CPAAS_CIOT, CPAAS_CEBK, CPAAS_ALT, CPAAS_CEVT, CPAAS_CDSC, AUTH_HOST, LOGIN_URL, LOGOUT_URL, AUTH_SELF_URL, VERSION_IS_OP, BKT_PUBLIC, BKT_PLATFORM, BKT_MSG, BKT_SDR, BKT_RPT, BKT_INVOICE, BKT_OCR, BKT_ADM, BKT_CWFP, BKT_CIMS, BKT_CITF, BKT_CIMP, BKT_CFILE, BKT_CIOT }; // #endregion